class MemberOfsController < ApplicationController
  def index
    @member_ofs = MemberOf.all
  end

  def show
    @member_of = MemberOf.find(params[:id])
  end

  def new
    @member_of = MemberOf.new
  end

  def create
    @member_of = MemberOf.new(params[:member_of])
    if @member_of.save
      redirect_to @member_of, :notice => "Successfully created member of."
    else
      render :action => 'new'
    end
  end

  def edit
    @member_of = MemberOf.find(params[:id])
  end

  def update
    @member_of = MemberOf.find(params[:id])
    if @member_of.update_attributes(params[:member_of])
      redirect_to @member_of, :notice  => "Successfully updated member of."
    else
      render :action => 'edit'
    end
  end

  def destroy
    @member_of = MemberOf.find(params[:id])
    @member_of.destroy
    redirect_to member_ofs_url, :notice => "Successfully destroyed member of."
  end
end
